package
{
	import com.harrynorthover.flar.helper.interfaces.IFlarApp;
	import com.harrynorthover.flar.helper.pv3d.FLAR_PV3D;
	
	import flash.filters.BlurFilter;
	
	import org.papervision3d.lights.PointLight3D;
	import org.papervision3d.materials.shadematerials.FlatShadeMaterial;
	import org.papervision3d.materials.utils.MaterialsList;
	import org.papervision3d.objects.primitives.Cube;
	
	[SWF(width="640", height="480", frameRate="30", backgroundColor="#FFFFFF")]

	public class BasicTest extends FLAR_PV3D implements IFlarApp
	{
		private var cube:Cube;
		
		public function BasicTest()
		{
			super(640, 480, 30);
		}
		
		override public function add3D():void
		{
			// Add you 3D stuff here. The more the better :-)
			var pl:PointLight3D = new PointLight3D();
			pl.z = -1000;
			pl.y = 1000;
			pl.x = 1000;
			pl.flipped = true;	
			
			var blurFilter:BlurFilter = new BlurFilter(24, 12, 1);
			var matList:MaterialsList = new MaterialsList();
			var fsm:FlatShadeMaterial = new FlatShadeMaterial(pl);
			
			matList.addMaterial(fsm, "all");
  			
  			cube = new Cube(matList, 60, 60, 60, 5, 5, 5);
  			cube.useOwnContainer = true;
  			cube.filters = [blurFilter];
  			
  			// FLAR_Container is the FLARBaseNode that you 
  			// add your 3D objects to.
	        FLAR_Container.addChild(cube);
		}
		
		override public function add3DAnimation():void
		{
			cube.yaw(10);
		}
		
	}
}